package top.mcwebsite.playandroid.business.user_article.impl.vm

import top.mcwebsite.playandroid.business.articles.api.model.ArticleModel
import top.mcwebsite.playandroid.lib.mvi.base.IIntent
import top.mcwebsite.playandroid.lib.mvi.base.IUiEffect
import top.mcwebsite.playandroid.lib.mvi.base.IUiState

data class UserArticleUIState(
    val message: String = "",
    val refreshing: Boolean = false,
    val collectionMap: Map<Long, Boolean> = emptyMap()
) : IUiState

sealed interface UserArticleIntent : IIntent {
    data class GoDetailPageIntent(val articleModel: ArticleModel) : UserArticleIntent

    data class CollectionArticleIntent(val articleModel: ArticleModel) : UserArticleIntent

    data class UnCollectionArticleIntent(val articleModel: ArticleModel): UserArticleIntent
}

sealed interface UserArticleUiEffect : IUiEffect {
    data class GoDetailPageUiEffect(val articleModel: ArticleModel) : UserArticleUiEffect

    object GoLoginPageUiEffect: UserArticleUiEffect
}